<div style="background: white">
    <table style="width: 100%; border-collapse: collapse; background: #232323; color: white;">
        <tr>
            <td style="padding: 5px; text-align: center"><b>{$data.task_data.title}</b></td>
            <td style="padding: 5px; text-align: center">Vytvorená: <b>{$data.task_data.added_formated}</b></td>
            <td style="padding: 5px; text-align: center">Posledná zmena: <b>{$data.task_data.updated_formated}</b></td>
            <td style="padding: 5px; text-align: center">Klient: <b>{$data.task_data.client_info.fullName}</b></td>
        </tr>
    </table>

    <table style="width: 100%; border-collapse: collapse; margin-top: 20px;">

        <tr>
            <td style="padding: 5px; text-align: left; background: #dcdcdc;"><b>Servisák</b></td>
            <td style="padding: 5px; text-align: center; background: #dcdcdc"><b>Počet hodín na tasku</b></td>
            <td style="padding: 5px; text-align: center; background: #dcdcdc"><b>Hodinový náklad</b></td>
            <td style="padding: 5px; text-align: center; background: #dcdcdc"><b>Fixné náklady</b></td>
            <td style="padding: 5px; text-align: center; background: #dcdcdc"><b>2. zložka</b></td>
            <td style="padding: 5px; text-align: center; background: #dcdcdc"><b>3. zložka</b></td>
            <td style="padding: 5px; text-align: center; background: #dcdcdc"><b>Súčet</b></td>
        </tr>
        {foreach $data.rows as $row}
            <tr>
                <td style="padding: 5px; text-align: left; border-bottom: 1px solid #dcdcdc; border-top: 1px solid #dcdcdc;">{$row.user_data.name} {$row.user_data.surname}</td>
                <td style="padding: 5px; text-align: center; border-bottom: 1px solid #dcdcdc; border-top: 1px solid #dcdcdc; ">{$row.sum_hours|round:"2"}</td>
                <td style="padding: 5px; text-align: center; border-bottom: 1px solid #dcdcdc; border-top: 1px solid #dcdcdc; ">{$row.sum_hour_expense|round:"2"}</td>
                <td style="padding: 5px; text-align: center; border-bottom: 1px solid #dcdcdc; border-top: 1px solid #dcdcdc; ">{$row.first|round:"2"}</td>
                <td style="padding: 5px; text-align: center; border-bottom: 1px solid #dcdcdc; border-top: 1px solid #dcdcdc; ">{$row.second|round:"2"}</td>
                <td style="padding: 5px; text-align: center; border-bottom: 1px solid #dcdcdc; border-top: 1px solid #dcdcdc; ">{$row.third|round:"2"}</td>
                <td style="padding: 5px; text-align: center; border-bottom: 1px solid #dcdcdc; border-top: 1px solid #dcdcdc; background: #f5f5f5">{$row.sum|round:"2"}</td>
            </tr>
        {/foreach}
        <tr>
            <td style="padding: 5px; text-align: left; background: #dcdcdc"><b>Súčet</b></td>
            <td style="padding: 5px; text-align: center; background: #dcdcdc"><b>{$data.sum_hours|round:"2"}</b></td>
            <td style="padding: 5px; text-align: center; background: #dcdcdc"><b></b></td>
            <td style="padding: 5px; text-align: center; background: #dcdcdc"><b>{$data.sum_first|round:"2"}</b></td>
            <td style="padding: 5px; text-align: center; background: #dcdcdc"><b>{$data.sum_second|round:"2"}</b></td>
            <td style="padding: 5px; text-align: center; background: #dcdcdc"><b>{$data.sum_third|round:"2"}</b></td>
            <td style="padding: 5px; text-align: center; background: #cdcdcd"><b>{$data.sum|round:"2"}</b></td>
        </tr>

    </table>
    {if $data.goods}
    <table style="width: 100%; border-collapse: collapse; margin-top: 20px;">
        <tr>
            <td style="padding: 5px; text-align: left; background: #dcdcdc;"><b>Tovar</b></td>
            <td style="padding: 5px; text-align: center; background: #dcdcdc"><b>Cena</b></td>
        </tr>
        {foreach $data.goods as $key => $goods}
            <tr>
                <td style="padding: 5px; text-align: left; border-bottom: 1px solid #dcdcdc; border-top: 1px solid #dcdcdc;">{$goods.description}</td>
                <td style="padding: 5px; text-align: center; border-bottom: 1px solid #dcdcdc; border-top: 1px solid #dcdcdc; ">{$goods.unit_price}</td>
            </tr>
        {/foreach}
    </table>
    {/if}
</div>